//点分十进制与unsigned int 32互转
/*
输入

10.3.3.193
167969729
输出

167773121
10.3.3.193
*/
#include <iostream>

using namespace std;

int main()
{
	unsigned int a, b, c, d;
	char ch;

	while (cin >> a >> ch >> b >> ch >> c >> ch >> d)
	{
		cout << (a << 24 | b << 16 | c << 8 | d) << endl;

		cin >> a;

		//a与相应位做与运算，只保留运算数字，然后右移，只输出与运算位
		cout << ((a & 0xff000000) >> 24) << "."
			<< ((a & 0x00ff0000) >> 16) << "."
			<< ((a & 0x0000ff00) >> 8) << "."
			<< (a & 0xff) << endl;
	}

	return 0;
}